const ruleDisplay = {
    // 鸟鹰渲染展示
    birdEagleDisplay: function (bird_eagle) {
        let rewarddisplay = "";
        rewarddisplay = "信天翁*" + bird_eagle.albtross +
            ",鹰*" + bird_eagle.eagle +
            ",鸟*" + bird_eagle.birdie +
            ",HIO*" + bird_eagle.hio +
            ",帕*" + bird_eagle.par;
        return rewarddisplay;
    },
    // 吃肉渲染展示
    eatMeatDisplay: function (eat_meat) {
        let display = "";
        if (eat_meat && eat_meat.type == 1) {
            display = "本洞输赢（不含奖励）"; //本洞输赢（含奖励）为一块肉，有Par吃1块，有Birdie吃2块，有Eagle吃3块
        } else if (eat_meat && eat_meat.type == 2) {
            display = "本洞输赢（含奖励）" +
                ((eat_meat.bogey_plus) ? (",有D.bogey吃" + eat_meat.bogey_plus + "块") : "") +
                ((eat_meat.bogey) ? (",有bogey吃" + eat_meat.bogey + "块") : "") +
                ((eat_meat.par) ? (",有par吃" + eat_meat.par + "块") : "") +
                ((eat_meat.birdie) ? (",有Birdie吃" + eat_meat.birdie + "块") : "") +
                ((eat_meat.eagle) ? (",有eagle吃" + eat_meat.eagle + "块") : "");
        } else if (eat_meat && eat_meat.type == 3) {
            display = "肉算一点";
        }
        return display;
    },
    // 顶洞渲染展示
    topHoleDisplay: function (top_hole) {
        let display = "";
        if (top_hole && top_hole.type == 1) {
            display = "顶洞平";
        } else if (top_hole && top_hole.type == 2) {
            display = (top_hole.value <= 0) ? "" : ("下洞加(" + top_hole.value + "分)");
        } else if (top_hole && top_hole.type == 3) {
            display = (top_hole.value <= 0) ? "" : ("下洞乘" + top_hole.value + "倍");
        } else if (top_hole && top_hole.type == 4) {
            display = "吃肉";
        }
        return display;
    },
    // 封顶渲染展示
    cappedDisplay: function (capped) {
        let display = "";
        if (capped && capped.type == 1) {
            display = "双帕封顶";
        } else {
            display = (capped.par_plus <= 0) ? "帕封顶" : ("+" + capped.par_plus + "封顶");
        }
        return display;
    },
    partModeDisplay: function (type) {
        const modeObj = { 1: '2人单挂', 2: '3人互挂' }
        return modeObj[type] || ''
    }
}

export default ruleDisplay